package com.bj58.groupbuy.action.service.impl;

import java.util.List;

import com.bj58.groupbuy.action.db.DBConfig;
import com.bj58.groupbuy.action.db.UserPriviledgeDao;
import com.bj58.groupbuy.action.model.UserPriviledge;
import com.bj58.groupbuy.action.service.UserPriviledgeService;

public class UserPriviledgeServiceImpl implements UserPriviledgeService {
	private static UserPriviledgeDao comDao = new UserPriviledgeDao();
	@Override
	public List<UserPriviledge> getByUserid(long userid) throws Exception {
		String sql = "select * from user_priviledge where userid='"+userid+"'";
		List<UserPriviledge> roleList=comDao.getAllColsByVo(sql, UserPriviledge.class, DBConfig.db_68_bi_sys.getIntType());
		if(null != roleList &&  !roleList.isEmpty()){
			return roleList;
		}
		return null;
	}

	@Override
	public boolean delByUserid(long userid) throws Exception {
		return comDao.deleteData("user_priviledge", " and userid='"+userid+"'", DBConfig.db_68_bi_sys.getIntType());
	}


}
